/***************************************************************************
 *  Copyright (C) 2009, 2010 by Axel Jaeger <axeljaeger@googlemail.com>    *
 *                                                                         *
 *  This file is part of Glowworm.                                         *
 *                                                                         *
 *  Glowworm is free software: you can redistribute it and/or modify       *
 *  it under the terms of the GNU General Public License as published by   *
 *  the Free Software Foundation, version 3 of the License.                *
 *                                                                         *
 *  Glowworm is distributed in the hope that it will be useful,            *
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 *  GNU General Public License for more details.                           *
 *                                                                         *
 *  You should have received a copy of the GNU General Public License      *
 *  along with Glowworm.  If not, see <http://www.gnu.org/licenses/>.      *
 ***************************************************************************/

#ifndef FILESERVLET_H
#define FILESERVLET_H

#include "AbstractServlet.h"

#include <QDir>
#include <QFileInfo>

class FileServlet : public AbstractServlet
{
public:
    explicit FileServlet(HttpServer* parent = NULL);
    ~FileServlet();
    void request(HttpRequest* request, HttpResponse* response);

    static QString mimeTypeForFile(const QFileInfo & file);

    QDir wwwRoot() const;
    void setWwwRoot(const QDir & dir);

protected:

private:
    QDir m_wwwRoot;

};

#endif // FILESERVLET_H
